using System;
using System.Data;
using System.Collections;

namespace APP.QUANLY.Entity
{
     /// <summary>
     /// Summary description for DONVI.
     /// </summary>
     public class DONVI
    {
              private Int32 _MADONVI;
      private string _TENDONVI;
      private bool _ISUSE;
      private MATHANGList _listMATHANG;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
		      public bool IsMADONVINullable
      { get { return false;  } }
      public Int32 MADONVI
      {
         get { return _MADONVI; }
         set { _MADONVI = value; }
      }
      public bool IsTENDONVINullable
      { get { return true;  } }
      public string TENDONVI
      {
         get { return _TENDONVI;  }
         set { _TENDONVI = value; }
      }
      public bool IsISUSENullable
      { get { return true;  } }
      public bool ISUSE
      {
         get { return _ISUSE;  }
         set { _ISUSE = value; }
      }
public MATHANGList MATHANGList 
{ 
	get { return _listMATHANG; }
	set { _listMATHANG = value;}
}

        #endregion

        #region Constructors
        public DONVI()
        {
            Reset();
        }
        public DONVI(DONVI obj)
        {
            	this._MADONVI = obj.MADONVI;
	this._TENDONVI = obj.TENDONVI;
	this._ISUSE = obj.ISUSE;
        }
        #endregion

        public void Reset()
        {
                     _MADONVI = EmptyValues.v_Int32;
         _TENDONVI = EmptyValues.v_string;
         _ISUSE = EmptyValues.v_bool;
	_listMATHANG = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["MADONVI"] is DBNull))
		{
			obj.MADONVI = (Int32)reader["MADONVI"];
		}
                if(!(reader["TENDONVI"] is DBNull))
		{
			obj.TENDONVI = (string)reader["TENDONVI"];
		}
                if(!(reader["ISUSE"] is DBNull))
		{
			obj.ISUSE = (bool)reader["ISUSE"];
		}
//            _MADONVI = (reader["MADONVI"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["MADONVI"];
//            _TENDONVI = (reader["TENDONVI"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["TENDONVI"];
//            _ISUSE = (reader["ISUSE"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["ISUSE"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(Int32 MADONVI, string TENDONVI, bool ISUSE)
        {
                     this._MADONVI = MADONVI;
         this._TENDONVI = TENDONVI;
         this._ISUSE = ISUSE;
        }
    }
}